﻿using System.Windows;
using System.Windows.Controls;

namespace Lottery.Client.SL.Controls
{
    //\\?
    public partial class AppendChase : ChildWindow
    {
        
        private bool erlQFVGfUs;
        //private ObservableCollection<LotteryChaseIsuses> SstQeZUjux;
        //private List<LotteryChaseIsuses> E8aQkU5npM;
        //private int G4ZQKC6W5X;
        private double CKZQWdAB0M;
        private int AkGQxvKeZF;
        private int kgFQJuPiSk;
        private int URLQI6Py5i;
        private string Wh1QwHULxp;
        public double _multiple;
        private string UcUQMGRSXn;
        private int AwGQPJ6PQm;
        private double gHKQNbfHyy;
        private int BUlQ3UqobM;
        private string LuXQlO0cVN;
        public AppendChase()
		{
            //this.SstQeZUjux = new ObservableCollection<LotteryChaseIsuses>();
			this.Wh1QwHULxp = "";
			this.UcUQMGRSXn = "";
			this.LuXQlO0cVN = "";
			this.InitializeComponent();
            //base.KeyUp+=(new KeyEventHandler(this.kr0Qc2tuGX));
            //this.cbChaseIsuses.add_SelectionChanged(new SelectionChangedEventHandler(this.jprQBAAvY3));
            //this.tbAppIsusesNumber.add_TextChanged(new TextChangedEventHandler(this.tynQX7cCGg));
            //this.btAddChase.add_Click(new RoutedEventHandler(this.ahuQ1YKmM4));
            //this.dgAppChase.ItemsSource = this.SstQeZUjux;
            //this.lbWaiting.set_Text(MsgInfo.waiting_c_1);
            //DataCache._ChildWindowObject = this;
		}
        
        public void Show(int LotteryID, string PlayTypeID, int isumNum, double dmultiple, string tschemeCount)
        {
            return;
            //this.kgFQJuPiSk = isumNum;
            //this._multiple = dmultiple;
            //this.UcUQMGRSXn = tschemeCount;
            //this.URLQI6Py5i = LotteryID;
            //this.Wh1QwHULxp = PlayTypeID;
            //this.gridMain.set_Visibility(1);
            //this.gridLoading.set_Visibility(0);
            //this.border_Processing.set_Visibility(0);
            //this.progressBarLoading.set_Visibility(0);
            //this.lbWaiting.set_Text(MsgInfo.waiting_c_1);
            //base.Show();
            //App.app_client.GetChaseIsuseCompleted += new ClientControl.RecvDataEventHandler(this.OSLQENFg8n);
            //App.app_client.GetChaseIsuse(LotteryID);
        }
        //private void OSLQENFg8n(object obj, byte[] array)
        //{
        //    App.app_client.GetChaseIsuseCompleted -= new ClientControl.RecvDataEventHandler(this.OSLQENFg8n);
        //    if (array == null)
        //    {
        //        this.lbWaiting.set_Text(BcZJxKMIDcH0kvSFls.w4WekCpilj(3004));
        //        this.lbWaiting.set_Foreground(new SolidColorBrush(Color.FromArgb(255, 0, 255, 0)));
        //        this.progressBarLoading.set_Visibility(1);
        //        return;
        //    }
        //    this.gridLoading.set_Visibility(1);
        //    this.gridMain.set_Visibility(0);
        //    this.SstQeZUjux.Clear();
        //    this.E8aQkU5npM = LotteryChaseIsusesInfo.GetChaseIsuses(array);
        //    using (List<LotteryChaseIsuses>.Enumerator enumerator = this.E8aQkU5npM.GetEnumerator())
        //    {
        //        while (enumerator.MoveNext())
        //        {
        //            LotteryChaseIsuses current = enumerator.get_Current();
        //            current.Multiple = this._multiple;
        //            current.IsuseMoney = ((double)this.kgFQJuPiSk * this._multiple).ToString() + BcZJxKMIDcH0kvSFls.w4WekCpilj(2998) + DataCache.Units;
        //            this.SstQeZUjux.Add(current);
        //        }
        //    }
        //    if (this.SstQeZUjux == null)
        //    {
        //        this.lbWaiting.set_Text(MsgInfo.pub_s_998);
        //        this.lbWaiting.set_Foreground(new SolidColorBrush(Color.FromArgb(255, 0, 255, 0)));
        //        this.progressBarLoading.set_Visibility(1);
        //        return;
        //    }
        //    this.border_Processing.set_Visibility(1);
        //    this.gridMain.set_Visibility(0);
        //    using (IEnumerator<LotteryChaseIsuses> enumerator2 = this.SstQeZUjux.GetEnumerator())
        //    {
        //        while (enumerator2.MoveNext())
        //        {
        //            LotteryChaseIsuses current2 = enumerator2.get_Current();
        //            ComboBoxItem comboBoxItem = new ComboBoxItem();
        //            comboBoxItem.set_Tag(current2.ID);
        //            comboBoxItem.SetValue(ContentControl.ContentProperty, current2.IsuseName);
        //            this.cbChaseIsuses.get_Items().Add(comboBoxItem);
        //        }
        //    }
        //    this.tbAppMultiple.set_Text(this._multiple.ToString());
        //    int.TryParse(this.tbAppIsusesNumber.get_Text().Trim(), ref this.G4ZQKC6W5X);
        //    double.TryParse(this.tbAppMultiple.get_Text().Trim(), ref this.CKZQWdAB0M);
        //    this.cbChaseIsuses.set_SelectedIndex(0);
        //    this.BUlQ3UqobM = this.G4ZQKC6W5X;
        //    this.gHKQNbfHyy = this._multiple * (double)this.BUlQ3UqobM * (double)this.kgFQJuPiSk;
        //    this.pR7Qy0tNUT();
        //}
        //private void kr0Qc2tuGX(object obj, KeyEventArgs keyEventArgs)
        //{
        //    if (8 == keyEventArgs.get_Key())
        //    {
        //        base.DialogResult = new bool?(true);
        //    }
        //}
        //private void cbSelect_Click(object sender, RoutedEventArgs e)
        //{
        //    if (sender != null)
        //    {
        //        CheckBox checkBox = sender as CheckBox;
        //        if (checkBox.get_Tag() != null)
        //        {
        //            this.itsQ8AJXvr();
        //        }
        //    }
        //}
        //private void itsQ8AJXvr()
        //{
        //    this.LuXQlO0cVN = "";
        //    this.gHKQNbfHyy = 0.0;
        //    this.BUlQ3UqobM = 0;
        //    IEnumerator enumerator = this.dgAppChase.ItemsSource.GetEnumerator();
        //    try
        //    {
        //        while (enumerator.MoveNext())
        //        {
        //            object current = enumerator.get_Current();
        //            if (this.dgAppChase.Columns.get_Item(0).GetCellContent(current) != null)
        //            {
        //                CheckBox checkBox = this.dgAppChase.Columns.get_Item(0).GetCellContent(current).FindName(BcZJxKMIDcH0kvSFls.w4WekCpilj(3020)) as CheckBox;
        //                if (checkBox.get_Tag() != null)
        //                {
        //                    bool? isChecked = checkBox.get_IsChecked();
        //                    if (isChecked.GetValueOrDefault() && isChecked.get_HasValue())
        //                    {
        //                        TextBox textBox = this.dgAppChase.Columns.get_Item(2).GetCellContent(current).FindName(BcZJxKMIDcH0kvSFls.w4WekCpilj(3040)) as TextBox;
        //                        double num = PublicFunction.StrToDouble(textBox.get_Text());
        //                        if (num <= 0.0)
        //                        {
        //                            this.gHKQNbfHyy = 0.0;
        //                            App.ShowMsg((current as LotteryChaseIsuses).IsuseName.ToString() + BcZJxKMIDcH0kvSFls.w4WekCpilj(3112));
        //                            break;
        //                        }
        //                        this.BUlQ3UqobM++;
        //                        TextBlock textBlock = this.dgAppChase.Columns.get_Item(3).GetCellContent(current).FindName(BcZJxKMIDcH0kvSFls.w4WekCpilj(3062)) as TextBlock;
        //                        this.gHKQNbfHyy += num * (double)this.kgFQJuPiSk;
        //                        textBlock.set_Text((num * (double)this.kgFQJuPiSk).ToString() + BcZJxKMIDcH0kvSFls.w4WekCpilj(3094) + DataCache.Units);
        //                        string luXQlO0cVN = this.LuXQlO0cVN;
        //                        this.LuXQlO0cVN = string.Concat(new string[]
        //                        {
        //                            luXQlO0cVN,
        //                            checkBox.get_Tag().ToString(),
        //                            BcZJxKMIDcH0kvSFls.w4WekCpilj(3100),
        //                            num.ToString(),
        //                            BcZJxKMIDcH0kvSFls.w4WekCpilj(3106)
        //                        });
        //                    }
        //                }
        //            }
        //        }
        //    }
        //    finally
        //    {
        //        IDisposable disposable = enumerator as IDisposable;
        //        if (disposable != null)
        //        {
        //            disposable.Dispose();
        //        }
        //    }
        //    this.pR7Qy0tNUT();
        //}
        //private void pR7Qy0tNUT()
        //{
        //    this.tbkShowInfo.set_Text(string.Concat(new object[]
        //    {
        //        BcZJxKMIDcH0kvSFls.w4WekCpilj(3130),
        //        this.kgFQJuPiSk,
        //        BcZJxKMIDcH0kvSFls.w4WekCpilj(3138),
        //        this.BUlQ3UqobM.ToString(),
        //        BcZJxKMIDcH0kvSFls.w4WekCpilj(3154),
        //        this.gHKQNbfHyy,
        //        BcZJxKMIDcH0kvSFls.w4WekCpilj(3172),
        //        DataCache.Units
        //    }));
        //}
        //private void jprQBAAvY3(object obj, SelectionChangedEventArgs selectionChangedEventArgs)
        //{
        //    int.TryParse((this.cbChaseIsuses.get_SelectedValue() as ComboBoxItem).get_Tag().ToString(), ref this.AkGQxvKeZF);
        //    if (this.AkGQxvKeZF < 1)
        //    {
        //        App.ShowMsg(BcZJxKMIDcH0kvSFls.w4WekCpilj(3178));
        //        return;
        //    }
        //    this.SetGridSouces();
        //}
        //private void tynQX7cCGg(object obj, TextChangedEventArgs textChangedEventArgs)
        //{
        //    if (!string.IsNullOrEmpty(this.tbAppIsusesNumber.get_Text().Trim()))
        //    {
        //        int.TryParse(this.tbAppIsusesNumber.get_Text().Trim(), ref this.G4ZQKC6W5X);
        //        if (this.G4ZQKC6W5X < 1)
        //        {
        //            App.ShowMsg(BcZJxKMIDcH0kvSFls.w4WekCpilj(3202));
        //            return;
        //        }
        //        this.SetGridSouces();
        //    }
        //}
        //private void tbAllMultiple_LostFocus(object sender, RoutedEventArgs e)
        //{
        //    if (sender != null)
        //    {
        //        TextBox textBox = sender as TextBox;
        //        if (!string.IsNullOrEmpty(textBox.get_Text().Trim()))
        //        {
        //            double num = 0.0;
        //            double.TryParse(textBox.get_Text().Trim(), ref num);
        //            if (num > 0.0)
        //            {
        //                this.itsQ8AJXvr();
        //            }
        //        }
        //    }
        //}
        //public void SetGridSouces()
        //{
        //    this.AwGQPJ6PQm = 0;
        //    this.SstQeZUjux.Clear();
        //    if (this.G4ZQKC6W5X > 0 && this.CKZQWdAB0M > 0.0 && this.AkGQxvKeZF > 0)
        //    {
        //        using (List<LotteryChaseIsuses>.Enumerator enumerator = this.E8aQkU5npM.GetEnumerator())
        //        {
        //            while (enumerator.MoveNext())
        //            {
        //                LotteryChaseIsuses current = enumerator.get_Current();
        //                if (current.ID >= this.AkGQxvKeZF)
        //                {
        //                    if (this.AwGQPJ6PQm >= this.G4ZQKC6W5X)
        //                    {
        //                        break;
        //                    }
        //                    this.AwGQPJ6PQm++;
        //                    this.SstQeZUjux.Add(current);
        //                }
        //            }
        //        }
        //        this.itsQ8AJXvr();
        //    }
        //}
        //private void ahuQ1YKmM4(object obj, RoutedEventArgs routedEventArgs)
        //{
        //    this.itsQ8AJXvr();
        //    if (!string.IsNullOrEmpty(this.LuXQlO0cVN) && this.LuXQlO0cVN.Split(new char[]
        //    {
        //        '|'
        //    }).Length > 0 && this.kgFQJuPiSk > 0 && this.gHKQNbfHyy > 0.0)
        //    {
        //        LotteryChaseInfo lotteryChaseInfo = new LotteryChaseInfo();
        //        lotteryChaseInfo.LotteryID = this.URLQI6Py5i;
        //        lotteryChaseInfo.PlayTypeID = DataCache._CurrentPlayInfo.iPlayTypeID;
        //        lotteryChaseInfo.IsusesCount = this.BUlQ3UqobM;
        //        lotteryChaseInfo.InvestNum = this.kgFQJuPiSk;
        //        lotteryChaseInfo.AllsumMoney = this.gHKQNbfHyy;
        //        lotteryChaseInfo.SchemeMoney = (double)this.kgFQJuPiSk;
        //        lotteryChaseInfo.SchemeTitle = Encrypt.sEncrypt(DataCache._CurrentPlayInfo.LotteryName + BcZJxKMIDcH0kvSFls.w4WekCpilj(3222) + DataCache._CurrentPlayInfo.PlayName + BcZJxKMIDcH0kvSFls.w4WekCpilj(3240));
        //        if (!DataCache._CurrentPlayInfo.PlayName.Contains(BcZJxKMIDcH0kvSFls.w4WekCpilj(3246)))
        //        {
        //            lotteryChaseInfo.LotteryNumber = Encrypt.sEncrypt(this.UcUQMGRSXn);
        //        }
        //        else
        //        {
        //            lotteryChaseInfo.LotteryNumber = this.UcUQMGRSXn;
        //        }
        //        lotteryChaseInfo.ChaseCount = this.LuXQlO0cVN;
        //        LotteryChaseInfo arg_15F_0 = lotteryChaseInfo;
        //        bool? isChecked = this.cbStop.get_IsChecked();
        //        arg_15F_0.WinStop = (isChecked.GetValueOrDefault() && isChecked.get_HasValue());
        //        this.gridMain.set_Visibility(1);
        //        this.gridLoading.set_Visibility(0);
        //        this.border_Processing.set_Visibility(0);
        //        this.progressBarLoading.set_Visibility(0);
        //        App.app_client.InitiateChaseCompleted += new ClientControl.RecvCodeEventHandler(this.mtOQpdDw3e);
        //        App.app_client.InitiateChase(lotteryChaseInfo);
        //    }
        //}
        //private void mtOQpdDw3e(object obj, string text)
        //{
        //    App.app_client.InitiateChaseCompleted -= new ClientControl.RecvCodeEventHandler(this.mtOQpdDw3e);
        //    if (string.IsNullOrEmpty(text))
        //    {
        //        App.ShowMsg(MsgInfo.pub_s_999);
        //        base.DialogResult = new bool?(true);
        //        return;
        //    }
        //    this.lbWaiting.set_Text(MsgInfo.bet_s_6 + BcZJxKMIDcH0kvSFls.w4WekCpilj(3254) + text);
        //}
        private void cbSelect_Click(object sender, RoutedEventArgs e)
        {
            App.ShowMsg("Not Implemented!");
        }

        private void tbAllMultiple_LostFocus(object sender, RoutedEventArgs e)
        {
            App.ShowMsg("Not Implemented!");
        }
    }
}
